3.23 \(\int (a+b \sec ^2(e+f x))^2 \sin ^2(e+f x) \, dx\)

Optimal. Leaf size=73 \[ \frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac{a (a-4 b) \tan (e+f x)}{2 f}+\frac{1}{2} a x (a-4 b)+\frac{b^2 \tan ^3(e+f x)}{3 f} \]

[Out]

(a*(a - 4*b)*x)/2 - (a*(a - 4*b)*Tan[e + f*x])/(2*f) + (a^2*Sin[e + f*x]^2*Tan[e + f*x])/(2*f) + (b^2*Tan[e +
f*x]^3)/(3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0989284, antiderivative size = 73, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {4132, 463, 459, 321, 203} \[ \frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac{a (a-4 b) \tan (e+f x)}{2 f}+\frac{1}{2} a x (a-4 b)+\frac{b^2 \tan ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sec[e + f*x]^2)^2*Sin[e + f*x]^2,x]

[Out]

(a*(a - 4*b)*x)/2 - (a*(a - 4*b)*Tan[e + f*x])/(2*f) + (a^2*Sin[e + f*x]^2*Tan[e + f*x])/(2*f) + (b^2*Tan[e +
f*x]^3)/(3*f)

Rule 4132

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_), x_Symbol] :> With[{ff = Fr
eeFactors[Tan[e + f*x], x]}, Dist[ff^(m + 1)/f, Subst[Int[(x^m*ExpandToSum[a + b*(1 + ff^2*x^2)^(n/2), x]^p)/(
1 + ff^2*x^2)^(m/2 + 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[m/2] && Integer
Q[n/2]

Rule 463

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^2, x_Symbol] :> -Simp[((b*c - a*
d)^2*(e*x)^(m + 1)*(a + b*x^n)^(p + 1))/(a*b^2*e*n*(p + 1)), x] + Dist[1/(a*b^2*n*(p + 1)), Int[(e*x)^m*(a + b
*x^n)^(p + 1)*Simp[(b*c - a*d)^2*(m + 1) + b^2*c^2*n*(p + 1) + a*b*d^2*n*(p + 1)*x^n, x], x], x] /; FreeQ[{a,
b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1]

Rule 459

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*(e*x)^(m
+ 1)*(a + b*x^n)^(p + 1))/(b*e*(m + n*(p + 1) + 1)), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^2(e+f x) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (a+b+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (3 a^2-2 (a+b)^2-2 b^2 x^2\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}-\frac{(a (a-4 b)) \operatorname{Subst}\left (\int \frac{x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac{a (a-4 b) \tan (e+f x)}{2 f}+\frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}+\frac{(a (a-4 b)) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac{1}{2} a (a-4 b) x-\frac{a (a-4 b) \tan (e+f x)}{2 f}+\frac{a^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac{b^2 \tan ^3(e+f x)}{3 f}\\ \end{align*}

Mathematica [A]  time = 0.988913, size = 126, normalized size = 1.73 \[ -\frac{\sec ^3(e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (3 a \cos ^3(e+f x) (a \sin (2 (e+f x))-2 f x (a-4 b))-4 b (6 a-b) \sec (e) \sin (f x) \cos ^2(e+f x)-4 b^2 \tan (e) \cos (e+f x)-4 b^2 \sec (e) \sin (f x)\right )}{3 f (a \cos (2 (e+f x))+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sec[e + f*x]^2)^2*Sin[e + f*x]^2,x]

[Out]

-((b + a*Cos[e + f*x]^2)^2*Sec[e + f*x]^3*(-4*b^2*Sec[e]*Sin[f*x] - 4*(6*a - b)*b*Cos[e + f*x]^2*Sec[e]*Sin[f*
x] + 3*a*Cos[e + f*x]^3*(-2*(a - 4*b)*f*x + a*Sin[2*(e + f*x)]) - 4*b^2*Cos[e + f*x]*Tan[e]))/(3*f*(a + 2*b +
a*Cos[2*(e + f*x)])^2)

________________________________________________________________________________________

Maple [A]  time = 0.049, size = 71, normalized size = 1. \begin{align*}{\frac{1}{f} \left ({a}^{2} \left ( -{\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) +2\,ab \left ( \tan \left ( fx+e \right ) -fx-e \right ) +{\frac{{b}^{2} \left ( \sin \left ( fx+e \right ) \right ) ^{3}}{3\, \left ( \cos \left ( fx+e \right ) \right ) ^{3}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^2,x)

[Out]

1/f*(a^2*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+2*a*b*(tan(f*x+e)-f*x-e)+1/3*b^2*sin(f*x+e)^3/cos(f*x+e)^3
)

________________________________________________________________________________________

Maxima [A]  time = 1.48454, size = 90, normalized size = 1.23 \begin{align*} \frac{2 \, b^{2} \tan \left (f x + e\right )^{3} + 12 \, a b \tan \left (f x + e\right ) + 3 \,{\left (a^{2} - 4 \, a b\right )}{\left (f x + e\right )} - \frac{3 \, a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^2,x, algorithm="maxima")

[Out]

1/6*(2*b^2*tan(f*x + e)^3 + 12*a*b*tan(f*x + e) + 3*(a^2 - 4*a*b)*(f*x + e) - 3*a^2*tan(f*x + e)/(tan(f*x + e)
^2 + 1))/f

________________________________________________________________________________________

Fricas [A]  time = 0.503966, size = 189, normalized size = 2.59 \begin{align*} \frac{3 \,{\left (a^{2} - 4 \, a b\right )} f x \cos \left (f x + e\right )^{3} -{\left (3 \, a^{2} \cos \left (f x + e\right )^{4} - 2 \,{\left (6 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}\right )} \sin \left (f x + e\right )}{6 \, f \cos \left (f x + e\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^2,x, algorithm="fricas")

[Out]

1/6*(3*(a^2 - 4*a*b)*f*x*cos(f*x + e)^3 - (3*a^2*cos(f*x + e)^4 - 2*(6*a*b - b^2)*cos(f*x + e)^2 - 2*b^2)*sin(
f*x + e))/(f*cos(f*x + e)^3)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)**2)**2*sin(f*x+e)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.21921, size = 97, normalized size = 1.33 \begin{align*} \frac{2 \, b^{2} \tan \left (f x + e\right )^{3} + 12 \, a b \tan \left (f x + e\right ) + 3 \,{\left (a^{2} - 4 \, a b\right )}{\left (f x + e\right )} - \frac{3 \, a^{2} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^2,x, algorithm="giac")

[Out]

1/6*(2*b^2*tan(f*x + e)^3 + 12*a*b*tan(f*x + e) + 3*(a^2 - 4*a*b)*(f*x + e) - 3*a^2*tan(f*x + e)/(tan(f*x + e)
^2 + 1))/f